Debugging mechanism for a processor, arithmetic operation unit and processor

ABSTRACT

A debugging mechanism equipped within a processor and receiving, as inputs, respective pieces of arithmetic operation data related to a plurality of arithmetic units comprised within the processor, and receiving, as inputs, respective control signals used for the respective arithmetic operations, comprising: an unit which comprises a counter performing a counting operation synchronously with the arithmetic operation and comprises a plurality of OR circuits each receiving, as inputs, any of the respective control signals and a signal that is output when the counter value of the counter is a specific counter value; and a debug storage unit which comprises a plurality of storage units each receiving any of the respective pieces of arithmetic operation data, any of the respective outputs of the individual OR circuits, and the counter value, and each storing the arithmetic operation data and counter value when the output of the input OR circuit is valid.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation application of international PCT application No. PCT/JP2006/303652 filed on Feb. 27, 2006.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a debugging mechanism for a processor.

2. Description of the Related Art

The increase in the degree of integration and complexity in the logic of processors has been remarkable in recent years, causing the work time for debugging to be continually increasing. In a debugging of an arithmetic unit of a processor carried out Out of Order, it is important to know information (i.e., the history of arithmetic operations) indicating how each arithmetic unit has performed execution and in what sequence, thus requiring a configuration for recording and reading the information. Currently, a widely used method as one method for a debugging is to add a scan circuit to a latch incorporated in a processor and read the latch information. As a specific example, a known method is to add a scan circuit to a latch incorporated in, for example, a JTAG (Joint Test Action Group)—compliant processor and to read the information from the latch.

As a related art, there is a debugging mechanism employing a plurality of latches each equipped with a scan circuit and each recording the arithmetic operation information while shifting the information, thereby retaining the arithmetic operation execution information within the processor at a plurality of timings. The debugging mechanism according to the related art records the content of the individual arithmetic operation execution and the timing of the arithmetic operation execution of each arithmetic unit. That is, the related art provides a counter and records the counter value and the signal of a recording target (i.e., arithmetic operation data). This configuration enables a person performing debugging or someone else to know what arithmetic operation has been executed and in what sequence each of the arithmetic units has performed execution, just by scanning the recorded data. It has not been possible to know, however, the execution intervals (i.e., cycle intervals) between the individual arithmetic operations of each arithmetic unit, or to know the relative execution order of a plurality of arithmetic units (i.e., in some cases judging them clearly is not possible).

FIG. 12 exemplifies the configuration of a debugging mechanism according to the related art described above.

The debugging mechanism 100 shown in FIG. 12 comprises a counter 101, and individual storage units 110, 120 and 130, corresponding to the respective arithmetic units. The assumption here is that there are three arithmetic units (assuming the arithmetic units X, Y and Z, although none of them is shown in a drawing herein). Arithmetic unit X executes a prescribed arithmetic operation on the basis of the signal of recording target (noted as “record target signal” hereinafter) A (i.e., arithmetic operation-use input data) when control signal V_A, which is a startup control signal (VALID), turns to valid (“1”). Likewise, record target signal B and control signal V_B are input into arithmetic unit Y, and record target signal C and control signal V_C are input into arithmetic unit Z.

Further, assuming that the counter 101 is a 3-bit counter, a 3-bit count value is output from the COUNT terminal of the counter 101. Taking a storage unit 110 corresponding to the arithmetic unit X as an example, the storage unit 110 comprises a shift register 111, which receives a record target signal A as an input, and when the control signal V_A is “1”, stores the record target signal A and shifts it by one; and a shift register 112, which receives the count value as input, and when the control signal V_A is “1”, stores the count value and shifts it by one. The other storage units 120 and 130 are likewise configured, with the only difference being that the input and stored data and control signals are respectively different, i.e., record target signal B and control signal V_B, and record target signal C and control signal V_C.

Each shift register of each respective storage unit has the same configuration, with the only exception being that input data are different, and therefore the description here is provided by exemplifying the shift register 111. The shift register Ill is constituted by six registers, i.e., registers A1, A2, A3 □□□□ A6, in which a discretionary record target signal A externally input into the debugging mechanism 100 is first stored in register A1, then is shifted to register A2 when the next record target signal A is stored in register A1 and sequentially shifted to registers A3, A4, A5 and AG, one-by-one, after the signal is shifted out. The control signal V_A is also input into the shift register 112, so that, at every time the control signal V_A turns to “1”, the present count value of the counter 101 is stored in the shift register 112 anew and also the individual count values already stored in the respective registers of the shift register 112 are shifted to the immediate next registers, respectively.

Then, the pieces of data stored in the respective shift registers 111 through 132 are externally read (SCAN) at a discretionary timing. For example, assuming that the values and timings of the respective record target signals A through C and control signals V_A through V_C are as shown in FIGS. 13A through 13C, the pieces of data scanned from the respective shift registers 111 through 132 are as shown in FIGS. 14A through 14C. That is, each of the storage units 110 through 130 has records of the record target signal and counter value when the control signal is “1”.

Here, the counter 101 is a 3-bit counter, as described above, and therefore the counter counts up sequentially, i.e., 000, 001, 010 and so on, resets the count value when it reaches 111 and then again counts up in the sequence 000, 001, 010 and soon (which is called a cyclic counting). The respective storage units 110, 120 and 130 each stores, and shifts, the input record target signal A and count value only when the input control signal to the unit is “1”. Therefore, for example, the storage unit 110 stores/shifts the record target signal A and count value only when the count values are 010, 101, 000, 010, 011 and 111 (refer to FIG. 13A), and therefore the storage content of the storage unit 110 which is read out by scanning afterwards is as shown in FIG. 14A.

Note that a clock CLK input to the counter 101 is an internal clock of the processor and that the individual arithmetic units X through Z are also controlled in accordance with the clock CLK, and therefore the counter 101 will operate synchronously with these arithmetic operations. Further note that, referring to FIGS. 14A through 12C, each respective piece of data shown leftmost noted as “leftmost data” hereinafter) in the figure represents data stored in the register shown on the rightmost side (i.e., the register A6 in the case of the shift register 111) from among the individual shift registers shown in FIG. 12. That is, the leftmost data represents the oldest piece of data from among the recorded data. The pieces of data shown on the rightmost side in the figure as shown in FIGS. 14A through 14C are the newest pieces of storage information (i.e., the data stored in register A1 in the case of the shift register 111). The number of memory elements of each shift register shown in FIG. 12 is six, and therefore the data in the record target signal A=“1” and the count value=“010” shown, as an example, in FIG. 14A will be shifted out when a further piece of data is recorded anew.

At this point, let it be assumed that the person performing debugging considers the operating order of each arithmetic unit on the basis of data read (SCAN) from the storage units 110, 120 and 130, as occurs in actual debugging. FIGS. 15A through 15C show the operating order of each arithmetic unit, which may be able to be judged from the storage content shown in FIGS. 14A through 14C. Note that each of FIGS. 15A through 15C show the values of record target signals newly recorded at the time at which a new piece of data is recorded in each shift register.

Since the actual operating order is as shown in FIGS. 13A through 13C, FIG. 15A is a correct judgment result. From the storage content shown in FIGS. 14A through 14C, however, a judgment as shown in FIG. 15B or 15C can be made and therefore it will not be possible for the person performing debugging to know which judgment result is correct.

The cause for bringing about such a situation is that the counter 101 is cyclically operated as described above, and that, even if, for example, the count value=“101” is recorded, it sometimes happens that it is not possible to judge as to which cycle (i.e., the nth cycle) the count value=“101” has been recorded in. Of course, there are some cases in which it is possible to judge it. In the example shown here, the record target signal A can be clearly judged, resulting in the same judgment result for all of FIGS. 15A through 15C. This is because the first count value=“000” in the second cycle happened to be recorded in the case of the record target signal A, enabling the judgment that the previous record data is the first cycle and the following record data is the second cycle. This, however, premises that the counter 101 is operated only for the second cycle, and therefore, if it is operated for the third cycle and thereafter, the judgment will be disabled (because there is a case in which no data is recorded, for example, in the second cycle, making all pieces of record data following the count value “000” be the data recorded in the third cycle).

As for the case of the record target signals B and C, even if it is premised on operating the counter 101 only to the second cycle, there are conceivably plural patterns as exemplified in FIGS. 15A through 15C, disabling a judgment as to which of these is correct. Taking, for example, the record target signal B, it is correct to judge that only the data of the count value=“111” stored last is the data of the second cycle and that all other pieces of data are ones recorded in the first cycle as shown in FIG. 15A; there are conceivable possibilities that all pieces of data are of the second cycle as shown in FIG. 15B and of the first cycle as shown in FIG. 15C (and in addition, other patterns are also conceivable).

The problems for the present invention, related to a debugging mechanism retaining the arithmetic operation execution information pertaining to a processor, are to provide a debugging mechanism for recording an operation history of each arithmetic unit so as to judge clearly the execution sequence and cycle interval of each arithmetic unit or to judge a relative execution order of a plurality of arithmetic units, and to provide an arithmetic operation unit, processor and the like, which comprise the debugging mechanism.

SUMMARY OF THE INVENTION

According to the present invention, a debugging mechanism equipped within a processor and receiving, as inputs, respective pieces of arithmetic operation data related to a plurality of arithmetic units comprised within the processor, and receiving, as inputs, respective control signals used for the respective arithmetic operations comprises: a debug control unit that comprises a counter performing a counting operation synchronously with the arithmetic operation and comprises a plurality of OR circuits each receiving, as inputs, any of the respective control signals and a signal that is output when the counter value of the counter is a specific counter value; and a debug storage unit which comprises a plurality of storage units each receiving any of the respective pieces of arithmetic operation data, any of the respective outputs of the individual OR circuits, and the counter value, and each storing the arithmetic operation data and counter value when the output of the input OR circuit is valid.

While the respective storage units of the debugging mechanism basically store the arithmetic operation data and counter value when a control signal corresponding the storage unit is valid, the arithmetic operation data and counter value are stored as a check point even if the control signal is not valid when the counter value of the counter is a specific counter value. Thereafter, when debugging is carried out by scanning the data stored in the debug storage unit, it is possible to discern, on the basis of the check point, which cycle (i.e., the nth cycle) each piece of stored arithmetic operation data has been taken at. That is, it is possible to record the operation history of each arithmetic unit so as to judge clearly the execution order and cycle interval of each arithmetic unit, or a relative execution order of a plurality of arithmetic units.

A signal that is output when the counter value of the counter is a specific counter value may be, for example, an overflow signal output from the counter or the output of a comparator receiving, as inputs, a counter value output from the counter and the specific counter value.

Further, a configuration may be such that, for example, instead of the counter always performing a counting operation synchronously with the arithmetic operation, it performs the counting operation when any one or more of the respective control signals are valid.

This configuration makes it possible to avoid a situation in which data is extraneously stored as the check point even if a clock operating the counter cannot be stopped immediately after the completion of a test-use arithmetic operation.

Further, a configuration may be such that, for example, the counter operates synchronously with the arithmetic operation, or operates when any one or more of the respective control signals are valid, in accordance with an externally input mode signal.

This configuration makes it possible to record data for debugging in an operating method in accordance with the needs of the situation.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is the outline configuration diagram of an arithmetic operation unit comprising a debugging mechanism according to the present embodiment and a processor comprising the present arithmetic operation unit;

FIG. 2 exemplifies the configuration of a debugging mechanism according to preferred embodiment 1;

FIG. 3A exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 2;

FIG. 3B exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 2;

FIG. 3C exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 2;

FIG. 4 is a diagram showing the operation content and timing of each arithmetic unit judged on the basis of the data shown in FIGS. 3A through 3C;

FIG. 5A is a diagram showing the record data shown in FIG. 3A almost disappearing;

FIG. 5B is a diagram showing the record data shown in FIG. 3B almost disappearing;

FIG. 5C is a diagram showing the record data shown in FIG. 3C almost disappearing;

FIG. 6 exemplifies the configuration of a debugging mechanism according to preferred embodiment 2;

FIG. 7 is a diagram showing the operation timing of a counter according to embodiment 2;

FIG. 8A exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 6;

FIG. 8B exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 6;

FIG. 8C exemplifies data stored in each storage unit equipped in the debugging mechanism shown in FIG. 6;

FIG. 9 is a diagram showing the operating order of individual arithmetic units judged from the record data shown in FIGS. 8A through 8C;

FIG. 10 exemplifies the configuration of a debugging mechanism according to preferred embodiment 3;

FIG. 11 exemplifies the configuration of a debugging mechanism according to a modified example of embodiment 1;

FIG. 12 exemplifies the configuration of a debugging mechanism according to a conventional technique;

FIG. 13A exemplifies the value and timing of record target signal A and control signal V_A;

FIG. 13B exemplifies the value and timing of record target signal B and control signal V_B;

FIG. 13C exemplifies the value and timing of record target signal C and control signal V_C;

FIG. 14A is data stored in a shift register in the example shown in FIG. 13A;

FIG. 14B is data stored in a shift register in the example shown in FIG. 13B;

FIG. 14C is data stored in a shift register in the example shown in FIG. 13C;

FIG. 15A is a diagram showing the operating order of individual arithmetic units estimable from the storage content shown in FIG. 14A;

FIG. 15B is a diagram showing the operating order of individual arithmetic units estimable from the storage content shown in FIG. 14B; and

FIG. 15C is a diagram showing the operating order of individual arithmetic units estimable from the storage content shown in FIG. 14C.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The following is a description of the preferred embodiment of the present invention by referring to the accompanying drawings.

FIG. 1 is the outline configuration diagram of an arithmetic operation unit comprising a debugging mechanism according to the present embodiment and a processor comprising the present arithmetic operation unit.

Referring to FIG. 1, the processor 10 comprises an instruction control unit 11, a data control unit 12, and an arithmetic logical unit 20. The arithmetic logical unit 20 comprises an arithmetic and control unit 21, individual arithmetic units 22, 23 and 24, and a debugging mechanism 30. The debugging mechanism 30 comprises a debug control unit 31 and a debug storage unit 32.

In the arithmetic logical unit 20, the arithmetic and control unit 21 controls the respective arithmetic units 22, 23 and 24 on the basis of a control signal issued from the instruction control unit 11. The individual arithmetic units 22, 23 and 24 each execute a prescribed arithmetic operation (“arithmetic operation” is also simply noted as “operation” hereinafter) using data input from the data control unit 12 to each respective arithmetic unit (i.e., operation-use input data) by way of the arithmetic and control unit 21 in accordance with control signals V_A, V_B and V_C, which are output from the arithmetic and control unit 21. In the example shown in FIG. 1, the signals A, B and C are input into the arithmetic units 22, 23 and 24, respectively, as operation-use input data. These signals A, B and C are also input into the debug storage unit 32 of the debugging mechanism 30. Likewise, the control signals V_A, V_B and V_C, which are input into the respective arithmetic units 22, 23 and 24, are also input into the debug control unit 31 of the debugging mechanism 30.

Note that the configuration shown in FIG. 1 is merely an example. While the debug storage unit 32 is for recording the history of arithmetic operations (i.e., operation data and execution timing) as in the case of the related art, the above described example uses operation-use input data as the operation data to be recorded; this is, however, arbitrary and, rather, the operation data to be recorded may use the operation execution result of the respective arithmetic units 22, 23 and 24. Alternatively, both the operation-use input data and operation execution result may be recorded as operation data. Of course, in such a situation signal lines need to be equipped (not shown in a drawing herein) for inputting the outputs of the respective arithmetic units 22, 23 and 24 to the debug storage unit 32.

The debug control unit 31 outputs a counter value output from a counter incorporated in the debug control unit 31 to the debug storage unit 32 as in the case of the related art. The debug control unit 31 also generates control signals a, b and c on the basis of the input control signals V_A, V_B and V_C, respectively, and outputs the generated control signals to the debug storage unit 32. Note that various kinds of signals are output from the arithmetic and control unit 21 so that each control signal V_A, V_B and V_C is a startup control signal (VALID) of each respective arithmetic unit as one of the various control signals. Note that the MODE signal shown in FIG. 1 is required for preferred embodiment 3, described later; it is not required for the other preferred embodiments. Meanwhile, a clock CLK (not shown in a drawing herein), which is an internal clock of the processor 10, is also input into the debug control unit 31, as in the case of the related art.

The debugging mechanism 30 is for recording the history of operations (i.e., operation data and execution timing) of each arithmetic unit, for making it possible to carry out debugging effectively by specifically recording only generally useful information, and for recording information so as to judge the execution order and cycle interval of each arithmetic unit or a relative execution order of a plurality of arithmetic units clearly and accurately in the present debugging.

First, FIG. 2 shows the configuration according to a preferred embodiment 1 as the configuration of such a debugging mechanism 30.

In the configuration example of the debugging mechanism 30 according to embodiment 1 shown in FIG. 1, first, the debug control unit 31 comprises a counter 41 and individual OR circuits 42, 43 and 44. The counter 41 operates on the clock CLK, and outputs a counter value that is then input into the debug storage unit 32. This is the same as the related art. The present embodiment is configured to further utilize an overflow signal OVF output from the counter 41. That is, the overflow signal OVF is input into one input terminal of each of the OR circuits 42, 43 and 44. The control signals V_A, V_B and V_C are input into the other input terminals of the respective OR circuits 42, 43 and 44. With this, the control signals a, b and c, which are outputs of the respective OR circuits 42, 43 and 44, changes to “1” not only when the control signals V_A, V_B and V_C are “1”, but also when the counter 41 overflows (i.e., the overflow signal OVF changes to “1”).

Incidentally, the description of the present embodiment means that “the control signal is valid” when each control signal V_A or the like is “1”, and that “the output of the OR circuit is valid” when the output of an individual OR circuit 42 or the like is “1”; the configuration of turning to be valid when these are “1” is arbitrary.

In comparison with the related art controlling the storage units by the control signals V_A, V_B and V_C, the present embodiment is configured to use the control signals a, b and c, instead. Then, when the counter 41 overflows, the control signals a, b and c are forced to change to “1”, regardless of the values of the control signals V_A, V_B and V_C, so that a recording/shift operation is carried out in the debug storage unit 32 at this time. That is, data constituting a checkpoint enabling a judgment as to which cycle (i.e., the nth cycle) each piece of record data is taken at, when a debugging is carried out later, will be recorded. When the control signals V_A, V_B and V_C are “1”, a recording/shift operation is carried out in the debug storage unit 32 as a matter or course, as in the conventional technique.

The debug storage unit 32 comprises storage units 50, 60 and 70. The storage unit 50 is the storage unit for recording the operation history of the arithmetic unit 24, and here records a signal A, which is input data to the arithmetic unit 24, together with the counter value. The present embodiment, however, also records a control signal “a”. Likewise, the storage unit 60 records the operation history of the arithmetic unit 23, and the storage unit 70 records the operation history of the arithmetic unit 22.

While the storage units 50 through 70 have different data to be input and to store, the configuration per se is the same, and therefore the description here is provided by using the storage unit 50 as representative. The storage unit 50 comprises shift registers 51, 52 and 53. All shift registers 51, 52 and 53 are controlled by the control signal “a” so that the input data is stored/shifted when the control signal “a” is “1”. The input data of the shift register 51 is the signal A, that of the shift register 52 is the count value, and that of the shift register 53 is the control signal V_A. The configurations of the individual shift registers per se are the same and therefore the description is provided by exemplifying the shift register 51. The shift register 51 comprises six registers, i.e., registers A11 through A16, and signal A is first stored in the register A11 and then shifted to registers A12 to A13 to A14 to A15 and to A16, sequentially, and is shifted out in the end. Such storing/shift operations of signal A are performed every time the control signal changes to “1”.

Here, the reason for also recording the control signal V_A, which is different from the related art, is that, as compared to the related art in which data is recorded only when the control signal V_A is “1” and thereby only valid data is recorded, the present embodiment is configured to store data also when the overflow signal OVF is “1” and therefore the control signal V_A is also recorded in order to make it possible to judge whether the record data is valid or invalid when carrying out a debugging. Conversely, while all pieces of recorded data are valid in the conventional debugging mechanism, the data constituting the checkpoint is also recorded according to the present method and therefore all pieces of recorded data are not necessarily valid data.

FIGS. 3A through 3C show data stored in the respective storage units 50 through 70 equipped in the debugging mechanism 30 shown in FIG. 2 described above. Note that the data and counter value input into the debugging mechanism 30 are the same as those in FIGS. 13A through 13C. Further note that the method for interpreting FIGS. 3A through 3C is the same as that described for FIG. 14 (according to the present method, however, the values of the control signals V_A, V_B and V_C are recorded).

In the examples shown in FIGS. 3A through 3C, the data stored at the counter value “000” in the first cycle of the counter 41 is already shift out and therefore the data stored in the next cycle is the oldest piece of data. In other words, the data is always recorded at the counter value “000” according to the present method, and therefore, if the data at the counter value “000” in the first cycle is not recorded as the oldest piece of data, the data is clearly shifted out.

Further, premising here that the counter 41 is operated until the second cycle, the data at the counter value “000” in FIGS. 3A through 3C are actually the first pieces of data in the second cycle. Therefore, it is possible to judge, with the data stored as the checkpoint being defined as the border, the data recorded before the border as the data taken in the first cycle and the data recorded after the border as the data taken in the second cycle. This makes it clear that, among the recorded data related to the respective signals A, B and C shown in FIGS. 3A through 3C, all pieces of data shown on the left side of the check point are data taken in the first cycle.

Taking, for example, the signal B shown in FIG. 3B, it is clear that all pieces of data of the counter values “010”, “011”, “100” and “110” are data taken in the first cycle. Furthermore, the value of the control signal V_B at the counter value “000” is “0”, and therefore it is clear that the data is invalid (i.e., the data is recorded as merely a check point) and that the record data taken in the second cycle is only the data at the counter value “111”.

As described above, the configuration in which data is always recorded at the overflow timing of the counter 41 makes it possible to judge clearly, by scanning the record data shown in FIGS. 3A through 3C, that the operation content (i.e., input values in this case) and timing of the respective arithmetic units 22 through 24 are as shown in FIG. 4.

Incidentally, the debugging mechanism 30 comprises a scan unit (not shown in a drawing herein), as does Japanese patent application number 2004-222398, so that the scan unit reads data stored in each of the shift registers.

Next is a description of preferred embodiment 2.

The configuration of embodiment 1 does not bring about a problem in the case of stopping the clock CLK input into the counter 41, that is, stopping the internal clock of the arithmetic logical unit 20, immediately after the completion of a test-use arithmetic operation control for the respective arithmetic units 22 through 24; it is possible for the clock CLK to advance in association with another control operation, resulting in a scan being performed after the counter 41 undergoes a number of cycles and the recorded information is read.

In such a case, since data (even if it is invalid data) is always recorded when the counter value is “000” according to the present method as described above, a further piece of data at the counter value “000” will be recorded for each single cycle of the counter 41, in addition to the record data shown in FIG. 3. Consequently, pieces of data are sequentially shifted out from the older data, and, as a result, the data stored in the respective storage units 50, 60 and 70 turn out to be as shown in FIGS. 5A through 5C if a scan is performed after four cycles of the counter 41 following the completion of a test-use arithmetic operation for, for example, the respective arithmetic units 22 through 24. As shown in FIGS. 5A through 5C, because four extraneous pieces of data at the counter value “000” are recorded, most of the valid data to be primarily stored (i.e., recorded in an actual arithmetic operation) is shifted out and lost, with only two pieces of data remaining (i.e., the two pieces of data at the counter values “011” and “111” in the example of FIG. 5A)

Embodiment 2 is the embodiment dealing with the case in which the above described problem occurs. Incidentally, a conceivable configuration may be to input a control signal from the outside of the debugging mechanism 30 (e.g., from the arithmetic and control unit 21) to the debugging mechanism 30 in order to stop the counter when a test-use arithmetic operation is completed; an extraneous comprisal and control for the purpose is required. The debugging mechanism is the configuration added only for a debug, which has no relationship with the fundamental operation of the processor 10, and therefore the addition of extraneous comprisal and control is not desirable. It is accordingly preferable to solve the above described problem within the debugging mechanism 30.

FIG. 6 exemplifies the configuration of a debugging mechanism 30 according to embodiment 2.

In the delineation of FIG. 6, the same component sign is assigned to configurations that are approximately similar to those of FIG. 2. First, the configuration of a debug storage unit 32 is the same as that of FIG. 2 (i.e., storage units 50, 60 and 70). Further, in a debug control unit 31, OR circuits 42, 43 and 44, each of which can receive any of control signals V_A, V_B and V_C as one input and the overflow signal OVF as the other input, are similar to those of FIG. 2.

The difference between the configuration of FIG. 6 and that of FIG. 2 is that the former comprises, first, a counter 81 that is an INH input terminal-equipped counter, and further, a 3-input OR circuit 82 and a NOT circuit 83. As is widely known, the INH is an inhibit input, so that the counter 81 performs a count-up operation in the usual manner in accordance with a clock CLK when an “L” signal (“0”) is input into the INH input terminal, while it does not perform a count-up operation when an “H” signal (“1”) is input into the INH input terminal. Further, a signal that is the NOT circuit 83-inverted output of the 3-input OR circuit 83 is input into the INH input terminal in the configuration shown in the drawing.

The inputs to the 3-input OR circuit 83 are the three control signals V_A, V_B and V_C. Therefore, when one or more control signals from among the three control signals V_A, V_B and V_Care “1”, the counter 81 of embodiments performs a count-up operation because an “L” signal is input to the INH input terminal, enabling the counter. In contrast, when all three control signals V_A, V_B and V_C are “0”, the counter 81 does not perform a count-up operation because an “H” signal is input to the INH input terminal. Further, all control signals V_A, V_B and V_C turn to “0” upon completion of the test-use arithmetic operation and therefore the counter 81 never performs a count-up operation even if the clock CLK advances.

FIG. 7 shows the operation timing of the counter 81 according to embodiment 2 (where the input data is the same as in FIG. 13).

When all three control signals V_A, V_B and V_C are “0”, the counter 81 does not perform a count-up operation as shown in FIG. 7 (the counter value being blank in the drawing means that the counter value does not change). When all three control signals V_A, V_B and V_C are “0”, a storing/shifting operation of new data is of course not carried out in any of the three storage units 50, 60 and 70. When the counter 81 operates as shown in FIG. 7, the content of data stored in the respective storage units 50, 60 and 70 is as shown in FIGS. 8A through SC. Comparing FIGS. 8A through 8C with FIGS. 3A through 3C, they are approximately the same; the only difference is in the counter values.

Then, even if the situation arises in which the clock CLK does not stop as described above, immediately after recording the last piece of data (i.e., the data at the counter value “011” in the second cycle) shown in FIG. 7, all three control signals V_A, V_B and V_C are “0” at the completion of a test and accordingly the counter 81 does not perform a count-up operation. Therefore, the counter value of the counter 81 remains at “011” thereafter so that no new piece of data of a check point will be recorded in any of three storage units 50, 60 and 70. This in turn causes the data read out by scanning thereafter to be the same as the data shown in FIGS. 8A through 8C, and thus the above described problem is solved.

FIG. 9 shows the operating order of individual arithmetic units judged from the record data shown in FIGS. 8A through 8C.

Even if the counter value is different from that of FIG. 3, a relative operating order of the individual arithmetic units can be judged without a problem as shown in FIG. 9. The execution interval (i e., a cycle interval) of the individual arithmetic operation of the arithmetic unit for each of them, however, is not known. Incidentally, it appears that the execution interval of individual arithmetic operations for each arithmetic unit is seemingly understood also in FIG. 9. For example, related to signal A (i.e., related to the arithmetic unit 24), the execution interval between the operation at the timing of the count value “000” in the second cycle and that at the timing of the count value “011” in FIG. 9 is seemingly understood as equivalent to three cycles on the clock CLK. Correctly, however, the execution interval between the two operations noted above is equivalent to four cycles on the clock CLK, and thus a reference to FIG. 9 leads to an erroneous judgment.

The following is a description of preferred embodiment 3.

As described above, if a clock CLK cannot be stopped immediately after the completion of a test-use arithmetic operation, the configuration according to embodiment 1 allows the information stored with effort to be shifted out and lost.

In contrast, embodiment 2 is capable of solving the problem of the above described embodiment 1, and yet a mere reference to the recorded counter value will not provide an understanding of the execution interval (i.e., the cycle interval) of the individual arithmetic operation for each arithmetic unit.

This problem is not a matter of which of the embodiments 1 or 2 is superior (or inferior). Rather, the viable solution is to use either of the embodiments 1 or 2 (i.e., whichever is suitable to the situation) selectively in accordance with the situation.

Preferred embodiment 3 is accordingly configured to enable a changeover between the two control methods, i.e., the methods of embodiments 1 and 2, by means of an externally input mode signal, thereby enabling a debugging in accordance with the situation.

FIG. 10 exemplifies the configuration of a debugging mechanism 30 according to embodiment 3.

As shown in the drawing, the configuration of FIG. 10 is approximately the same as that of FIG. 6 (i.e., embodiment 2), and the same component sign is assigned to the same configuration as that of FIG. 6. The following description is provided for only the different aspects. Note that the configuration of a debug storage unit 32 is the same as the configurations of FIGS. 2 and 6, and therefore it is not provided in FIG. 10, thus showing only the configuration of a debug control unit 31.

The configuration of FIG. 10 differs from that of FIG. 6 in that the former is equipped with a NOR circuit 91 in place of the NOT circuit 83 comprised in the configuration of FIG. 6. The output of a 3-input OR circuit 82 is input into one input terminal of the NOR circuit 91, and a MODE signal, which is externally input into the debugging mechanism 30, is input into the other input terminal of the NOR circuit 91. Note that the MODE signal may be generated and output by an instruction control unit 11 in accordance with an external instruction of, for example, a processor 10. Such a configuration is arbitrary, and the MODE signal may be generated by a certain control unit within the processor 10 or may be generated in an arithmetic logical unit 20.

The NOR circuit 91 outputs “1” only when both of the two inputs are “0”. Therefore, if a use of the control method of embodiment 1 is desired, the MODE signal need merely be turned to “1”. If the MODE signal is “1”, the output of the NOR circuit 91 always turns to “0” (i.e., an “L” signal (“0”) is always input to the INH input terminal of the counter 81) regardless of the output of the OR circuit 82 (that is, regardless of the values of the respective control signals V_A, V_B and V_C).

In the meantime, if a use of the control method of embodiment 2 is desired, the MODE signal is merely to be turned to “0”. In this case, if the output of the OR circuit 82 is “1”, that is, if all control signals V_A, V_B and V_C are “0”, then the output of the NOR circuit 91 turns to “1” and thus an “H” signal (“1”) is input to the INH input terminal of the counter 81. In this state, the counter 81 does not perform a count-up operation even if the clock CLK advances as described above. It is, however, clear that the output of the NOR circuit 91 turns to “0” when any one or more of the control signals V_A, V_B and V_C are “1”.

Lastly, a modified embodiment of the present embodiment is described.

The above described embodiments 1, 2 and 3 are configured to record a check point at the timing of the counter overflowing (i.e., count value “000”); the configuration is arbitrary. For example, an arbitrarily pre-specified specific timing may be used for a check point.

FIG. 11 exemplifies the configuration of such a modified embodiment.

In the modified embodiment, the configuration of a debug storage unit 32 is the same as the configurations of FIG. 2 and the like, and therefore it is not provided in FIG. 11, while only the configuration of a debug control unit 31 is shown herein.

FIG. 11 is the modified embodiment corresponding to embodiment 1 (refer to FIG. 2), and accordingly the same component sign is assigned to the approximately similar comprisals to that of FIG. 2 (the difference is that the overflow signal OVF of the counter 41 is not used as an input to the individual OR circuits 42, 43 and 44) . The following description is provided for only the aspects that are different from the configuration of FIG. 2.

The configuration of FIG. 11 differs from that of FIG. 2 in that the former is equipped with a comparator 100, as shown in the figure. A counter value output from the counter 41 is input to one input terminal of the comparator 100 and a CHK_NUMBER signal is input to the other input terminal thereof, as shown in the figure. As in the case of the MODE signal, the CHK_NUMBER signal, being externally input into the debugging mechanism 30, allows free changing of the settings from the outside. The comparator outputs “1” only when the two input values are identical. The output of the comparator 100 is a single input to each of the OR circuits 42, 43 and 44. That is, the present modified embodiment is configured to use the output of the comparator 100 in place of the overflow signal OVF shown in FIG. 2. Then, if, for example, CHK_NUMBER “101” is set, the output of the respective OR circuits 42, 43 and 44 will be “1” without fail when the counter value of the counter 41 is “101”, so that the data at this timing is recorded as a check point in the debug storage unit 32.

Note that the configuration, as shown in FIG. 11, of using the output of the comparator 100 in place of using an overflow signal OVF can also be applied to embodiments 2 and 3.

Note further that each of the above described embodiments, including the configuration of FIG. 1, is configured to use, as input data (i.e., signals A, B and C) to the respective arithmetic units 22 through 24 (i.e., the signals A, B and C) data to be stored in the debug storage unit 32 as the data indicating the respective arithmetic operations of each arithmetic unit; such a configuration is arbitrary. An alternative configuration may be a configuration to record, for example, the output data (i.e., arithmetic operation results) from the respective arithmetic units 22 through 24. In this case, the output signal lines from the respective arithmetic units 22 through 24 are of course connected to the debug storage unit 32. Alternatively, both the input and output data may be recorded.

Note also that the embodiments described above have exemplified a shift register as the specific example of the debug storage unit 32, however, the example is arbitrary. The debug storage unit 32 may be random access memory (RAM) or the like. In any case, however, the storage capacity of the storage unit 32 is small. The reason is that a debugging mechanism is added for the purpose of testing and is not needed for actual operation and thus the debugging mechanism may not be equipped with a large capacity storage unit (because other circuits are pressured) A similar consideration is necessary for the counter for which the use of large-bit counter prevents the above described problem (i.e., the problem of being unable to discern as to which cycle (i.e. , the nth cycle) the counter value is taken at, due to using the counter cyclically) . Actually, however, there is no room for equipping a debugging mechanism, as in the case of the storage unit, with a large scale counter.

Note further that the counter used in the above described embodiments is configured to perform a count-up operation; the counter may of course be configured to perform a count-down operation.

As described above, the debugging mechanism according to the present embodiment makes it possible to record the operation history of each arithmetic unit so as to judge clearly the execution order and cycle interval of each arithmetic unit or a relative execution order of a plurality of arithmetic units. 

1. A debugging mechanism equipped within a processor and receiving, as inputs, respective pieces of arithmetic operation data related to a plurality of arithmetic units comprised within the processor, and receiving, as inputs, respective control signals used for the respective arithmetic operations, comprising: a debug control unit which comprises a counter performing a counting operation synchronously with the arithmetic operation and comprises a plurality of OR circuits each receiving, as inputs, any of the respective control signals and a signal that is output when the counter value of the counter is a specific counter value; and a debug storage unit which comprises a plurality of storage units each receiving any of the respective pieces of arithmetic operation data, any of the respective outputs of the individual OR circuits, and the counter value, and each storing the arithmetic operation data and counter value when the output of the input OR circuit is valid.
 2. The debugging mechanism according to claim 1, wherein said signal that is output when the counter value of said counter is a specific counter value is an overflow signal output from the counter.
 3. The debugging mechanism according to claim 1, wherein said signal that is output when the counter value of said counter is a specific counter value is the output of a comparator receiving, as inputs, a counter value output from the counter and said specific counter value.
 4. The debugging mechanism according to claim 1, wherein said counter, instead of always performing a counting operation synchronously with said arithmetic operation, performs the counting operation when any one or more of said respective control signals are valid.
 5. The debugging mechanism according to claim 1, wherein said counter operates synchronously with said arithmetic operation, or operates when any one or more of said respective control signals are valid, in accordance with an externally input mode signal.
 6. An arithmetic operation unit which is equipped within a processor and which incorporates a debugging mechanism receiving, as inputs, respective pieces of arithmetic operation data related to a plurality of arithmetic units comprised within the arithmetic operation unit and receiving, as inputs, respective control signals used for the respective arithmetic operations, wherein the debugging mechanism comprises a debug control unit which comprises a counter performing a counting operation synchronously with the arithmetic operation and comprises a plurality of OR circuits each receiving, as inputs, any of the respective control signals and a signal that is output when the counter value of the counter is a specific counter value; and a debug storage unit which comprises a plurality of storage units each receiving any of the respective pieces of arithmetic operation data, any of the respective outputs of the individual OR circuits, and the counter value, and storing the arithmetic operation data and counter value when the output of the input OR circuit is valid.
 7. A processor comprising the arithmetic operation unit incorporating the debugging mechanism according to claim
 6. 